﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace smforj.common.dao
{
    /// <summary>
    /// 基本Dao
    /// </summary>
    public class BaseDaoImpl : BaseDao
    {  
         
        /// <summary>
        /// 根据连接字符串获取
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public string GetConnStr(string str)
        {
            string[] R = str.Split(new char[] { ';', ';', ';', ';' }); 
            string sIP = R[1].Substring(R[1].IndexOf("=") + 1, (R[1].Length - 1 - R[1].IndexOf("=")));
            string sDbName = R[4].Substring(R[4].IndexOf("=") + 1, (R[4].Length - 1 - R[4].IndexOf("=")));
            string sRoot = R[2].Substring(R[2].IndexOf("=") + 1, (R[2].Length - 1 - R[2].IndexOf("=")));
            string sPsd = R[3].Substring(R[3].IndexOf("=") + 1, (R[3].Length - 1 - R[3].IndexOf("=")));
            return GetConnStr(sIP.Trim(), sDbName.Trim(), sRoot.Trim(), sPsd.Trim());
        }

        /// <summary>
        /// 获取连接字符串
        /// </summary>
        /// <param name="sIP"></param>
        /// <param name="sDbName"></param>
        /// <param name="sRoot"></param>
        /// <param name="sPsd"></param>
        /// <returns></returns>
        public string GetConnStr(string sIP, string sDbName, string sRoot, string sPsd)
        {
            return null;
        }
    }
}
